<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
        body {
            font-size: 18px;
        }
 

        .nav ul, .nav li {
            margin: 0;
            padding: 0;
    
        }

        .nav ul {
            /* 为了消除line元素的空格 */
            font-size: 0;
        }

      .nav li {
        display: inline-block;
        width: 100px;
        font-size:18px;
        color: black;
        /* background-color: black; */

        border: 1px solid black;
        text-align: center;
        margin: 0;
      }

      .nav li:hover {
          background-color: gray;
      }

      .nav a {
          /* 去掉超链的下划线*/
          text-decoration: none;
          color: black;
      }

      .header {
          background-color: blanchedalmond;
          margin-bottom: 5px;
          padding: 10px;
      }

      .nav {
            background-color: blanchedalmond;
            margin-bottom: 5px;
            /* height:  50px; */
      }
 
      .main {

          height: 800px;
          background-color: blanchedalmond;
          margin-bottom: 5px;
      }
      


      .footer {
          text-align: center;
        background-color: blanchedalmond;
        padding: 10px;
      }
    </style>
  </head>
  <body>
    <div class="container">
        <div class="header"><h1>水平导航练习</h1></div>
        <div class="nav">
        <ul>
        <li>
            <a href="#">菜单1</a>
            <!-- <ul>
                <li>子菜单1</li>
                <li>子菜单2</li>
                <li>子菜单3</li>
            </ul> -->
        </li>
        <li>
            <a href="#">菜单2</a>
        </li>
        <li>
            <a href="#">菜单3</a>
        </li>
      </ul>

        </div>
        <div class="main">主体
            <!-- <ul style="line-">
                <li>item1</li>
                <li>item2</li>
                <li>item3</li>
            </ul> -->


        </div>
        <div class="footer">&copy;2021 王绍陇</div>
      

    </div>
  </body>
</html>
